package com.tjl.service.Impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjl.mapper.UserMapper;
import com.tjl.model.Admin;
import com.tjl.model.User;
import com.tjl.service.AdminService;
import com.tjl.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Admin
* @description 针对表【admin】的数据库操作Service实现
* @createDate 2022-06-07 19:59:40
*/
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin>
    implements AdminService{

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Admin login(Admin user) {
        LambdaQueryWrapper<Admin> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Admin::getUsername,user.getUsername())
                .eq(Admin::getPassword,user.getPassword());
        return adminMapper.selectOne(wrapper);
    }


}
